home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1257 / payment.c_ / payment.c
C/C++ Source or Header  |  1997-04-18  |  1KB  |  46 lines

  1. /* EasyCODE(C++) V5.1 01.03.1995 08:24:59
  2. Program for paying an invoice */
  3. /* EasyCODE O
  4. If=horizontal
  5. LevelNumbers=no
  6. LineNumbers=no
  7. ScreenFont=MS Sans Serif,,80,9217,-13,0,400,0,0,0,0,0,0,1,2,1,34
  8. PrinterFont=Courier,,100,2,-42,0,400,0,0,0,0,0,0,2,1,2,49
  9. LastLevelId=4 */
  10.  
  11. /* EasyCODE ( 2
  12.    Program for paying an invoice */
  13. #include <stdio.h>
  14. extern int amount();
  15. extern void writecheques();
  16.  
  17. /* EasyCODE F */
  18. void main()
  19.    {
  20.    int amountofinvoice;
  21.    int cash = 0;
  22.    int maximum = 2500;
  23.    int numberofcheques;
  24.    int remainingvalue;
  25.    if ((amountofinvoice=amount()) <= cash)
  26.       {
  27.       printf ("\nCash payment !");
  28.       }
  29.    else
  30.       {
  31.       numberofcheques = amountofinvoice/maximum;
  32.       remainingvalue = amountofinvoice%maximum;
  33.       while (numberofcheques != 0)
  34.          {
  35.          writecheques(maximum);
  36.          /* EasyCODE - */
  37.          --numberofcheques;
  38.          }
  39.       if (remainingvalue>0)
  40.          {
  41.          writecheque(remainingvalue);
  42.          }
  43.       }
  44.    }
  45. /* EasyCODE ) */
  46.